import { MAIN_COLOR, DEFAULT_COLOR } from '@/constant'
import { getItem, setItem } from '@/utils/storage'
import variables from '@/styles/variables.module.scss'
const state = {
  mainColor: getItem(MAIN_COLOR) || DEFAULT_COLOR,
  variables
}

const mutations = {
  changeDeafaultColor(state, mainColor) {
    state.mainColor = mainColor
    state.variables.menuBg = mainColor
    setItem(MAIN_COLOR, mainColor)
  }

}

const actions = {

}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
